package com.service.owner;

import com.common.ErrorCodeEnum;
import com.common.emums.DataStatus;
import com.common.exception.BusinessException;
import com.common.utils.StringUtils;
import com.core.springSecurity.common.SecurityUtils;

import com.dao.primary.owner.OwnerInfoMapper;
import com.model.pojo.owner.OwnerInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;



/**
 * @Author: zql
 * @Description: 经销商下面农机手信息服务
 * @Data: 2024-01-07
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class OwnerInfoService {
    private final  OwnerInfoMapper ownerInfoMapper;

    public int save(OwnerInfo info){
        info.setCreateTime(new Date());
        return ownerInfoMapper.insertSelective(info);
    }

    public OwnerInfo findByDealerAndOwner(Long dealerUserId,Long ownerUserId){
        return ownerInfoMapper.selectByDealerAndOwner(dealerUserId,ownerUserId);
    }
}
